<?php
/**
 * Created by PhpStorm.
 * User: yeluojun
 * Date: 14-5-7
 * Time: 下午11:31
 */

require_once 'common.php';
require_once 'quick.php';


Route();

function  Route(){
    do{

        if(!array_key_exists("PATH_INFO",$_SERVER)){
            $result = returnMsg(1,"路径错误",null);
            break;
        }
        $path = $_SERVER["PATH_INFO"];
        $req = $_REQUEST;

        $result = Route_handle($path,$req);
    }while(false);
    echo json_encode($result);
}



function Route_handle($arg_path,$arg_req){
    try{
        $rsl = null;
        switch ($arg_path){
            case "/quick";$rsl = quick_business($arg_req);break;
            default :$rsl=returnMsg(1,"路径错误",null);break;
        }
        return $rsl;
    }catch (Exception $e){
        return returnMsg(1,"系统异常",null);
    }
}


